var i18n = Em.Object.create({
            move: Em.Object.create({
                myAccounts: 'My Accounts',
                billPayment: 'Bill Payment',
                oneTimeBillPayment: 'One Time Bill Payment',
                thirdPartyTransfer: 'Third Party Transfer',
                addBillPayee: 'Add Bill Payee',
                seeYourTransferHistory: 'See Your Transfer History',
                to: 'To',
                from: 'From',
                date:'Date',
                startDate:'startDate',
                endDate:'endDate',
                amount:'Amount',
                description:'Description',
                noteTitle: 'Notes',
                frequency:'Frequency',
                repeat:'Repeat',
                repeatON:'ON',
                monthly:'Monthly',
                bankCharges:'Bank Charges',
                financeCharges:'Finance Charges',
                bankChargesLabel: 'Bank Charges',
                financeChargesLabel: 'Finance Charges',
                currentBalance: 'Current Balance:',
                cashAdvanceLimit:'Available Cash advance limit',
                accountName: 'Account Name:',
                accountNumber: 'Account Number:',
                availableBalance: 'Available Balance:',
                continueBtn:'Continue',
                eTacGenerateBtn:'Generate eTac',
                receiptNumber:'Receipt number',
                status:'Status',
                bankName:'Bank Name',
                transactionType:'Type',
                cashAdvance:'Cash Advance',
                indicativeExchangeRate:'Indicative Exchange Rate',
                equivalentAmount:'Equivalent Amount'
            })
        });



describe('BaseTransfer Model', function() {
    var transfer;
    var fail = function() { expect(false).toBeTruthy(); };
    beforeEach(function(){
        spyOn(App.i18n, 'getTranslations').andReturn(i18n);
        transfer = App.BaseTransfer.create({
        });
    });

    describe('displayableObjects', function() {
        it('keys of displayableRepeatObject should be in sequence', function() {
            var displayable = transfer.displayableRepeatObject();

            expect(displayable[0].key).toEqual('startDate');
            expect(displayable[1].key).toEqual('Repeat');
            expect(displayable[2].key).toEqual('Frequency');
            expect(displayable[3].key).toEqual('endDate');
        });

        it('keys of displayableCashAdvanceObject should be in sequence', function() {
            transfer.fromAccount = App.CardAccount.create();
            transfer.fromAccount.cashAdvanceLimit = 1000;

            var displayable = transfer.displayableCashAdvanceObject();

            expect(displayable[0].key).toEqual(App.i18n.getTranslations().get('move.cashAdvanceLimit'));
        });


    });


    describe('validation', function() {
        it('validateAmount should throw for empty amount', function() {
            try{
                transfer.validateAmount();
                fail();
            }catch(e) { }
        });

        it('validateAmount should throw for non-numberic amount', function() {
            try{
                transfer.validateAmount('ab123');
                fail();
            }catch(e) { }
        });

        it('validateAmount should ok for numberic amount', function() {
            transfer.validateAmount('123');
        });
    });
});




